<?php
namespace Tbf\Bundle\TaskManageBundle;
use Psr\Log\LoggerInterface;
use Tbf\Bundle\QueueBundle\QueueManager;

class TaskManager
{
    protected $queue_manager;
    protected $logger;
    public function __construct(QueueManager $queue_manager,LoggerInterface $logger)
    {
        $this->queue_manager = $queue_manager;
        $this->logger = $logger;
    }
    public function addTask(TaskInterface $task)
    {
        $this->logger->debug('tbf.task_manager add task',array(
            'class_name'=>get_class($task)
        ));
        $this->queue_manager->getQueue('tbf_task_manager')->write($task);
    }
}
